<?php

include('helpers/render_advanced.php');
include('helpers/number.php');
include('helpers/form.php');
include('helpers/links.php');



function partial($filename) {
	include $filename;
}


function image_tag($img_name, $html_opts = array()) {
	$img_path = image_path($img_name);
	$html_options = (empty($html_opts)) ? NULL : generate_html_options($html_opts);
	return "<img src='$img_path'{$html_options} />";
}



function image_path($img_name) {
	return (PUBLIC_HTML . 'images' . DS . $img_name . ".jpg");
}

function stylesheet_tag($action, $controller) {
	
}

function javascript_tag($action, $controller) {
	
}

function printstyles($action, $controller) {
	$root_folder = PUBLIC_HTML;
	return "<link id='customcss' href='{$root_folder}stylesheets/{$controller}/{$action}.css' rel='stylesheet' type='text/css' />\n";
}


function displaynotice() {
	if (isset($_SESSION['notice'])) {
		echo "<p id='notice'>{$_SESSION['notice']}</p>";
		unset($_SESSION['notice']);
	}
}


function loginlogout() {
	if (isset($_SESSION['login_indicator_uname'])) {
		echo link_to($_SESSION['login_indicator_uname'], array('controller' => 'staff', 'action' => 'menu'), array('id' => 'headeruname'));
		echo link_to('Logout', array('controller' => 'staff', 'action' => 'logout'), array('id' => 'headerlogin'));
	}
	else {
		echo link_to('Login',array('controller' => 'staff', 'action' => 'login'), array('id' => 'headerlogin'));
	}
	
	//onclick='return headerloginform();' <div id='loginformheader' style='display:none;'>" . (include(dirname(dirname(__FILE__)) . "/views/staff/_login_form.php")) . "</div>";
//onclick='return confirmation(\"Are you sure you want to log out?\");'
}

?>